<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        img {
            display: block;
            margin: 200px auto;
            width: 250px;
            transition: all 1s;
        }

        /* img:hover {
            transform: rotate(360deg);
        } */

        a {
            position: fixed;
            right: 50%;
            bottom: 5%;
            text-decoration: none;
            color: #000;
        }

        a:hover {
            color: red;
        }
    </style>
</head>

<body>
    <div>
        <img src="imges/pic.jpg" alt="">

    </div>
    <div>
        <a href="首页.html">返回首页</a>
    </div>
    <script>
        const  img = document.querySelector('img');
        img.addEventListener('click',function(){
            img.style.transform = 'rotate(300deg)';
        })
        img.addEventListener('mouseleave',function(){
            img.style.transform = 'rotate(0deg)'; 
        })
       
    </script>
</body>

</html>